package com.portico.dept.solarch

import org.apache.commons.lang.builder.HashCodeBuilder

class ClientProject implements Serializable{

    Client client ;
    Project project ;
    

    static constraints = {
    }

  	static mapping = {
		id composite: ['client', 'project']
		version false
	}

  	boolean equals(other) {
		if (!(other instanceof ClientProject)) {
			return false
		}

		other.client?.id == client?.id &&
			other.project?.id == project?.id
	}

	int hashCode() {
		def builder = new HashCodeBuilder()
		if (client) builder.append(client.id)
		if (project) builder.append(project.id)
		builder.toHashCode()
	}
}
